from TurtleWorld import *
from math import *
 
world=TurtleWorld()
peter = Turtle()
peter.delay = 0

#----------------------------TRIANGLES----------------------------#

def equilateral_tri(t, size=100, rotate=0):
    print "Equilateral Triangle, with Size:", size, "and Rotation:", rotate
    t.lt(rotate)
    for i in range(3):
        t.fd(size)
        t.lt(120)
    t.rt(rotate)
   
peter.pu()
peter.rt(90)
peter.fd(30)
peter.pd()
   
equilateral_tri(peter, 100, 100)
#--------------------------QUADRILATERALS-------------------------#

def para(t, width=100, height=100, angle=120, rotate=0):
    print "Parallelogram, with Width:", width, "Height:", height, "Angle:", angle, "and Rotation:", rotate

    t.lt(rotate)
    for i in range(2):
        t.fd(size)
        t.lt(angle)
        t.fd(size)
        t.lt(180-angle)
    t.rt(rotate)

def rhom(t, size=100, angle=120, rotate=0):
    print "Rhombus, with Size:", size, "Angle:", angle, "and Rotation:", rotate
    
    t.lt(rotate)
    for i in range(2):
        t.fd(size)
        t.lt(angle)
        t.fd(size)
        t.lt(180-angle)
    t.rt(rotate)



def rect(t, width=100, height=100, rotate=0):
    print "Rectangle, with Width:", width, "Height:", height, "and Rotation:", rotate
    
    for i in range(2):
        t.fd(size)
        t.lt(90)
    t.rt(rotate)



def square(t, size=100, rotate=0):
    print "Sqaure, with Size:", size, "and Rotation:", rotate
    t.lt(rotate)
    for i in range(4):
        t.fd(size)
        t.lt(90)
    t.rt(rotate)
 
#------------------------------MOVEMENT---------------------------#

def line(t, x=100, y=100):
    print "Line to a point X:", x, "over and Y:", y, "up"
    dist= sqrt(x**2 + y**2)
    angle= degrees(atan(y/float (x)))
    t.lt(angle)
    t.fd(dist)
    t.rt(angle)
line(peter, 100, 100)
 
equilateral_tri(peter, 100, 100)

peter.pu()
peter.bk(90)
peter.lt(90)
peter.fd(37)
peter.lt(90)
peter.pd()

line(peter, 100, 100)

peter.pu()
peter.bk(400)
peter.rt(90)
peter.fd(260)
peter.lt(90)
peter.fd(30)
peter.lt(40)
peter.pd()



def move(t, x, y):
    print "Move without marking to a point X:", x, "over and Y:", y, "up"
    t.pu()
    line(t, x, y)
    t.pd()

move(peter, 100, 100)



def arc(t, size=100):
    t.lt(90)
    for i in range(23):
        t.fd(size*3.3)
        t.rt(8)
    

    

       

rhom(peter, 00, 00, 00)   


#------------------------------OTHER SHAPES------------------------#
"""
Build any other shape functions you want.
Some Ideas:
    Right Triangles (sss, sas, etc)
    Arbitrary Triangles
    Circle
    Arcs
    Go Wild!
    
Bonus for working or challenging functions...no penalty for trying something
"""

#------------------------------TEST-------------------------------#

wait_for_user()